﻿# CMakeList.txt : Top-level CMake project file, do global configuration
# and include sub-projects here.
#
cmake_minimum_required (VERSION 3.8)

project ("anip")

add_definitions (-D _HAS_STD_BYTE=0)

set (OpenCV_DIR "D:\\Work\\opencv-3.4.16\\out\\bin")
set (OpenCV_LibDIR "D:\\Work\\opencv-3.4.16\\out\\lib")
#find_package (OpenCV REQUIRED)

# todo: auto download and extract from
# https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip
add_subdirectory ("glm-0.9.9.8" SYSTEM)

# https://github.com/glfw/glfw/archive/refs/tags/3.3.8.zip
add_subdirectory ("glfw-3.3.8" SYSTEM)

# https://mirror.ossplanet.net/nongnu/freetype/freetype-2.10.4.tar.gz
add_subdirectory ("freetype-2.10.4" SYSTEM)

# avoid conflict with glfw
set (RTAUDIO_TARGETNAME_UNINSTALL "uninstall_rtaudio")

# https://github.com/thestk/rtaudio/archive/refs/tags/5.1.0.zip
add_subdirectory ("rtaudio-5.1.0" SYSTEM)

add_subdirectory ("glad" SYSTEM)

add_subdirectory ("lcms-2.14" SYSTEM)

set (GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set (GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set (GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)

add_definitions (-D UINDEBUG)

if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
	add_definitions (-D DEBUG)
	add_definitions (-D USE_ERROR_CHECK)
	add_definitions (-D FT_CONFIG_OPTION_ERROR_STRINGS)
endif()

add_subdirectory ("anip")

# for gcc/clang
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")